<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <meta charset="UTF-8"/>
        <title>Treningslogger</title>
        <link rel="stylesheet" type="text/css" href="#{resource['css/style.css']}"/>
    </h:head>
    <h:body>
        <ui:composition template="/template.xhtml">
            <ui:define name="content">
                <h:form><div class="nyOkt">
                        <div><h:outputLabel for="dato" value="#{msg.dato2}"/><h:inputText id="dato" value="#{treningsOktBean.data.dato}" required="true"
                                                                                          requiredMessage="#{msg.dato_req}" label="#{msg.dato2}"
                                                                                          validatorMessage="#{msg.dato_err}" converterMessage="#{msg.dato_err}">
                                <f:convertDateTime pattern="dd-MM-yy"/>
                            </h:inputText></div>
                        <div><h:outputLabel for="varighet" value="#{msg.varighet}"/><h:inputText id="varighet" value="#{treningsOktBean.data.varighet}" required="true"
                                                                                                 requiredMessage="#{msg.varig_req}" label="#{msg.varighet}"
                                                                                                 validatorMessage="#{msg.varig_err}" converterMessage="#{msg.varig_err}">
                                <f:validateLongRange minimum="1" />
                            </h:inputText></div>
                        <div><h:outputLabel for="kategori" value="#{msg.kategori}"/><h:selectOneMenu id="kategori" value="#{treningsOktBean.data.kategori}" >

                                <f:selectItems value="#{kategoriFinner.kategorier}" var="k" itemLabel="#{k}" itemValue="#{k}"/>
                            </h:selectOneMenu></div>
                        <div><h:outputLabel for="tekst" value="#{msg.tekst}"/><h:inputTextarea id="tekst" value="#{treningsOktBean.data.tekst}" required="true" requiredMessage="#{msg.besk_req}">
                                <f:validateLength maximum="30"/>
                            </h:inputTextarea></div></div>
                    <h:commandButton action="#{treningsOktBean.lagre()}" id="sendOkt" value="#{msg.send}"/>
                </h:form></ui:define></ui:composition>
    </h:body>
</html>

